﻿namespace _26_C_中List集合的FindAll方法及其条件过滤问题
{
    internal class Program
    {
        static void Main(string[] args)
        {
            Console.Title = "C#中List集合的FindAll方法及其条件过滤问题";

            List<int> ints = new List<int>() { 1, 6, 3, 4, 5, 2, 1, 4, 5, 3, 4 };

            List<int> ret = ints.FindAll(num => num > 5);

            //List<int> ret1 = ints.FindAll(FilterNum); 都可以

            ret.ForEach(FilterForeach);

            foreach (int i in ret) { Console.WriteLine(i); }

            Console.ReadKey();
        }

        static bool FilterNum(int num) { return num > 5; }

        static void FilterForeach(int num)
        {
            num += 5; 
        }
    }
}
